namespace BXS.API.Models
{
    /// <summary>
    /// 订单商品
    /// </summary>
    public class OrderProduct
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 价格
        /// </summary>
        public decimal Price { get; set; }
    }

    /// <summary>
    /// 订单模型
    /// </summary>
    public class Order
    {
        /// <summary>
        /// 订单ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 订单号
        /// </summary>
        public string OrderNo { get; set; } = string.Empty;

        /// <summary>
        /// 客户姓名
        /// </summary>
        public string CustomerName { get; set; } = string.Empty;

        /// <summary>
        /// 客户电话
        /// </summary>
        public string CustomerPhone { get; set; } = string.Empty;

        /// <summary>
        /// 订单金额
        /// </summary>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 订单状态
        /// </summary>
        public string Status { get; set; } = "pending";

        /// <summary>
        /// 支付方式
        /// </summary>
        public string PaymentMethod { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public string CreateTime { get; set; } = string.Empty;

        /// <summary>
        /// 商品列表
        /// </summary>
        public List<OrderProduct> Products { get; set; } = new List<OrderProduct>();
    }

    /// <summary>
    /// 订单创建请求
    /// </summary>
    public class CreateOrderRequest
    {
        /// <summary>
        /// 客户姓名
        /// </summary>
        public string CustomerName { get; set; } = string.Empty;

        /// <summary>
        /// 客户电话
        /// </summary>
        public string CustomerPhone { get; set; } = string.Empty;

        /// <summary>
        /// 支付方式
        /// </summary>
        public string PaymentMethod { get; set; } = string.Empty;

        /// <summary>
        /// 商品列表
        /// </summary>
        public List<OrderProduct> Products { get; set; } = new List<OrderProduct>();
    }

    /// <summary>
    /// 订单状态更新请求
    /// </summary>
    public class UpdateOrderStatusRequest
    {
        /// <summary>
        /// 订单ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 新状态
        /// </summary>
        public string Status { get; set; } = string.Empty;
    }

    /// <summary>
    /// 支付结果
    /// </summary>
    public class PaymentResult
    {
        /// <summary>
        /// 支付是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 交易流水号
        /// </summary>
        public string TransactionId { get; set; } = string.Empty;

        /// <summary>
        /// 支付消息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 小程序支付参数
        /// </summary>
        public object? PayParams { get; set; }
    }
} 